/////////////////////////////////////////////////////////////////////////////
// Name:        ax_shortcutinputdialog.h
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     13/04/2009 22:29:50
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_SHORTCUTINPUTDIALOG_H_
#define _AX_SHORTCUTINPUTDIALOG_H_


/*!
 * Includes
 */

////@begin includes
////@end includes

#include "wx/timer.h"

#include "shortcutcust/shortcutcust.h"

/*!
 * Forward declarations
 */

////@begin forward declarations
class wxShortcutCtrl;
////@end forward declarations

class AxSpeech;

/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_AXSHORTCUTINPUTDIALOG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
#define SYMBOL_AXSHORTCUTINPUTDIALOG_TITLE _("Text Input")
#define SYMBOL_AXSHORTCUTINPUTDIALOG_IDNAME wxID_ANY
#define SYMBOL_AXSHORTCUTINPUTDIALOG_SIZE wxSize(400, 300)
#define SYMBOL_AXSHORTCUTINPUTDIALOG_POSITION wxDefaultPosition
////@end control identifiers


/*!
 * AxShortcutInputDialog class declaration
 */

class AxShortcutInputDialog: public wxDialog
{    
    DECLARE_DYNAMIC_CLASS( AxShortcutInputDialog )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    AxShortcutInputDialog();
    AxShortcutInputDialog( wxWindow* parent,
        const wxString& message, const wxString& caption, const wxShortcutItem& defaultValue,
        const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXSHORTCUTINPUTDIALOG_STYLE );

    /// Creation
    bool Create( wxWindow* parent,
        const wxString& message, const wxString& caption, const wxShortcutItem& defaultValue,
        const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = SYMBOL_AXSHORTCUTINPUTDIALOG_STYLE );

    /// Destructor
    ~AxShortcutInputDialog();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls(const wxShortcutItem& defaultValue, const wxString& message);

    void SetShortcut(const wxShortcutItem& shortcut) { m_shortcut = shortcut; }
    const wxShortcutItem& GetShortcut() const { return m_shortcut; }

    void SetShortcutManager(wxShortcutManager* manager) { m_shortcutManager = manager; }
    wxShortcutManager* GetShortcutManager() const { return m_shortcutManager; }

    void SetSpeech(AxSpeech* speech) { m_speech = speech; }
    AxSpeech* GetSpeech() const { return m_speech; }

    void SpeakCurrentShortcut(bool initialView = false);
    
    void OnTimer(wxTimerEvent& event);

////@begin AxShortcutInputDialog event handler declarations

    /// wxEVT_INIT_DIALOG event handler for wxID_ANY
    void OnInitDialog( wxInitDialogEvent& event );

    /// wxEVT_COMMAND_TEXT_UPDATED event handler for wxID_ANY
    void OnAnyTextUpdated( wxCommandEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
    void OnOkClick( wxCommandEvent& event );

////@end AxShortcutInputDialog event handler declarations

////@begin AxShortcutInputDialog member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end AxShortcutInputDialog member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin AxShortcutInputDialog member variables
    wxStaticText* m_descriptionCtrl;
    wxShortcutCtrl* m_valueCtrl;
    wxTextCtrl* m_detailsCtrl;
////@end AxShortcutInputDialog member variables

    wxShortcutItem      m_shortcut;
    wxShortcutManager*  m_shortcutManager;
    AxSpeech*           m_speech;
    bool                m_disableEvents;
    wxTimer             m_timer;
    long                m_lastSpoke;
};

#endif
    // _AX_SHORTCUTINPUTDIALOG_H_
